package ldh.fx.adminfx.ui;

import com.jfoenix.controls.JFXTextField;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;

public class ImageItem extends VBox {

    private Image image;
    private String title;

    public ImageItem(Image image, String title) {
        this.image = image;
        this.title = title;
        initUi();

        this.getStyleClass().add("image-item");
    }

    private void initUi() {
        ImageView imageView = new ImageView(image);
        imageView.setFitWidth(100);
        imageView.setFitHeight(80);
        Label label = new Label(title);
        this.setAlignment(Pos.TOP_CENTER);
        this.getChildren().addAll(imageView, label);
    }
}
